from collections import defaultdict
from skidl import Pin, Part, Alias, SchLib, SKIDL, TEMPLATE

from skidl.pin import pin_types

SKIDL_lib_version = '0.0.1'

RF_NFC = SchLib(tool=SKIDL).add_parts(*[
        Part(**{ 'name':'PN5321A3HN_C1xx', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'PN5321A3HN_C1xx'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:HVQFN-40-1EP_6x6mm_P0.5mm_EP4.1x4.1mm'], 'footprint':'Package_DFN_QFN:HVQFN-40-1EP_6x6mm_P0.5mm_EP4.1x4.1mm', 'keywords':'NFC', 'description':'', 'datasheet':'https://www.nxp.com/docs/en/nxp/data-sheets/PN532_C1.pdf', 'search_text':'/usr/share/kicad/symbols/RF_NFC.kicad_sym\nPN5321A3HN_C1xx\n\nNFC', 'pins':[
            Pin(num='1',name='DVSS',func=pin_types.PWRIN,unit=1),
            Pin(num='10',name='RX',func=pin_types.INPUT,unit=1),
            Pin(num='11',name='AVSS',func=pin_types.PWRIN,unit=1),
            Pin(num='12',name='AUX1',func=pin_types.OUTPUT,unit=1),
            Pin(num='13',name='AUX2',func=pin_types.OUTPUT,unit=1),
            Pin(num='14',name='OSCIN',func=pin_types.INPUT,unit=1),
            Pin(num='15',name='OSCOUT',func=pin_types.OUTPUT,unit=1),
            Pin(num='16',name='I0',func=pin_types.PASSIVE,unit=1),
            Pin(num='17',name='I1',func=pin_types.PASSIVE,unit=1),
            Pin(num='18',name='TESTEN',func=pin_types.PASSIVE,unit=1),
            Pin(num='19',name='P35',func=pin_types.BIDIR,unit=1),
            Pin(num='2',name='LOADMOD',func=pin_types.OUTPUT,unit=1),
            Pin(num='20',name='N.C.',func=pin_types.NOCONNECT,unit=1),
            Pin(num='21',name='N.C.',func=pin_types.NOCONNECT,unit=1),
            Pin(num='22',name='N.C.',func=pin_types.NOCONNECT,unit=1),
            Pin(num='23',name='PVDD',func=pin_types.PWRIN,unit=1),
            Pin(num='24',name='P30/UART_RX',func=pin_types.BIDIR,unit=1),
            Pin(num='25',name='P70_IRQ',func=pin_types.BIDIR,unit=1),
            Pin(num='26',name='~{RSTOUT}',func=pin_types.OUTPUT,unit=1),
            Pin(num='27',name='NSS/P50_SCL/HSU_RX',func=pin_types.BIDIR,unit=1),
            Pin(num='28',name='MOSI/SDA/HSU_TX',func=pin_types.BIDIR,unit=1),
            Pin(num='29',name='MISO/P71',func=pin_types.BIDIR,unit=1),
            Pin(num='3',name='TVSS1',func=pin_types.PWRIN,unit=1),
            Pin(num='30',name='SCK/P72',func=pin_types.BIDIR,unit=1),
            Pin(num='31',name='P31/UART_TX',func=pin_types.BIDIR,unit=1),
            Pin(num='32',name='P32_INT0',func=pin_types.BIDIR,unit=1),
            Pin(num='33',name='P33_INT1',func=pin_types.BIDIR,unit=1),
            Pin(num='34',name='SIC_CLK/P34',func=pin_types.BIDIR,unit=1),
            Pin(num='35',name='SIGOUT',func=pin_types.OUTPUT,unit=1),
            Pin(num='36',name='SIGIN',func=pin_types.INPUT,unit=1),
            Pin(num='37',name='SVDD',func=pin_types.OUTPUT,unit=1),
            Pin(num='38',name='~{RSTPD}',func=pin_types.INPUT,unit=1),
            Pin(num='39',name='DVDD',func=pin_types.PWROUT,unit=1),
            Pin(num='4',name='TX1',func=pin_types.OUTPUT,unit=1),
            Pin(num='40',name='VBAT',func=pin_types.PWRIN,unit=1),
            Pin(num='41',name='AVSS',func=pin_types.PASSIVE,unit=1),
            Pin(num='5',name='TVDD',func=pin_types.PWRIN,unit=1),
            Pin(num='6',name='TX2',func=pin_types.OUTPUT,unit=1),
            Pin(num='7',name='TVSS2',func=pin_types.PWRIN,unit=1),
            Pin(num='8',name='AVDD',func=pin_types.PWRIN,unit=1),
            Pin(num='9',name='VMID',func=pin_types.OUTPUT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'ST25DV04K-IER8C3', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'ST25DV04K-IER8C3'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm'], 'footprint':'Package_DFN_QFN:DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm', 'keywords':'NFC Tag', 'description':'', 'datasheet':'https://www.st.com/resource/en/datasheet/st25dv04k.pdf', 'search_text':'/usr/share/kicad/symbols/RF_NFC.kicad_sym\nST25DV04K-IER8C3\n\nNFC Tag', 'pins':[
            Pin(num='1',name='V_EH',func=pin_types.PWROUT,unit=1),
            Pin(num='2',name='AC0',func=pin_types.PASSIVE,unit=1),
            Pin(num='3',name='AC1',func=pin_types.PASSIVE,unit=1),
            Pin(num='4',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='5',name='SDA',func=pin_types.BIDIR,unit=1),
            Pin(num='6',name='SCL',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='GPO',func=pin_types.OPENCOLL,unit=1),
            Pin(num='8',name='VCC',func=pin_types.PWRIN,unit=1),
            Pin(num='9',name='NC',func=pin_types.NOCONNECT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'ST25DV16K-JFR6D3', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'ST25DV16K-JFR6D3'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm'], 'footprint':'Package_DFN_QFN:ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm', 'keywords':'NFC Tag', 'description':'', 'datasheet':'https://www.st.com/resource/en/datasheet/st25dv04k.pdf', 'search_text':'/usr/share/kicad/symbols/RF_NFC.kicad_sym\nST25DV16K-JFR6D3\n\nNFC Tag', 'pins':[
            Pin(num='1',name='LPD',func=pin_types.INPUT,unit=1),
            Pin(num='10',name='VDCG',func=pin_types.PWRIN,unit=1),
            Pin(num='11',name='GPO',func=pin_types.OUTPUT,unit=1),
            Pin(num='12',name='VCC',func=pin_types.PWRIN,unit=1),
            Pin(num='13',name='NC',func=pin_types.NOCONNECT,unit=1),
            Pin(num='2',name='NC',func=pin_types.NOCONNECT,unit=1),
            Pin(num='3',name='V_EH',func=pin_types.PWROUT,unit=1),
            Pin(num='4',name='AC0',func=pin_types.PASSIVE,unit=1),
            Pin(num='5',name='AC1',func=pin_types.PASSIVE,unit=1),
            Pin(num='6',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='7',name='SDA',func=pin_types.BIDIR,unit=1),
            Pin(num='8',name='SCL',func=pin_types.INPUT,unit=1),
            Pin(num='9',name='NC',func=pin_types.NOCONNECT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'ST25R3911B-AQW', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'ST25R3911B-AQW'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:VQFN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm_ThermalVias'], 'footprint':'Package_DFN_QFN:VQFN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm_ThermalVias', 'keywords':'NFC', 'description':'', 'datasheet':'https://www.st.com/resource/en/datasheet/st25r3911b.pdf', 'search_text':'/usr/share/kicad/symbols/RF_NFC.kicad_sym\nST25R3911B-AQW\n\nNFC', 'pins':[
            Pin(num='1',name='VDD_IO',func=pin_types.PWRIN,unit=1),
            Pin(num='10',name='RFO1',func=pin_types.OUTPUT,unit=1),
            Pin(num='11',name='RFO2',func=pin_types.OUTPUT,unit=1),
            Pin(num='12',name='VSN_RF',func=pin_types.PWRIN,unit=1),
            Pin(num='13',name='TRIM1_3',func=pin_types.PASSIVE,unit=1),
            Pin(num='14',name='TRIM2_3',func=pin_types.PASSIVE,unit=1),
            Pin(num='15',name='TRIM1_2',func=pin_types.PASSIVE,unit=1),
            Pin(num='16',name='TRIM2_2',func=pin_types.PASSIVE,unit=1),
            Pin(num='17',name='TRIM1_1',func=pin_types.PASSIVE,unit=1),
            Pin(num='18',name='TRIM2_1',func=pin_types.PASSIVE,unit=1),
            Pin(num='19',name='TRIM1_0',func=pin_types.PASSIVE,unit=1),
            Pin(num='2',name='CSO',func=pin_types.OUTPUT,unit=1),
            Pin(num='20',name='TRIM2_0',func=pin_types.PASSIVE,unit=1),
            Pin(num='21',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='22',name='RFI1',func=pin_types.PASSIVE,unit=1),
            Pin(num='23',name='RFI2',func=pin_types.PASSIVE,unit=1),
            Pin(num='24',name='AGD',func=pin_types.PASSIVE,unit=1),
            Pin(num='25',name='CSI',func=pin_types.PASSIVE,unit=1),
            Pin(num='26',name='VSN_A',func=pin_types.PWRIN,unit=1),
            Pin(num='27',name='IRQ',func=pin_types.OUTPUT,unit=1),
            Pin(num='28',name='MCU_CLK',func=pin_types.OUTPUT,unit=1),
            Pin(num='29',name='MISO',func=pin_types.OUTPUT,unit=1),
            Pin(num='3',name='VSP_D',func=pin_types.PWROUT,unit=1),
            Pin(num='30',name='MOSI',func=pin_types.INPUT,unit=1),
            Pin(num='31',name='SCLK',func=pin_types.INPUT,unit=1),
            Pin(num='32',name='/SS',func=pin_types.INPUT,unit=1),
            Pin(num='33',name='EP',func=pin_types.PWRIN,unit=1),
            Pin(num='4',name='XTO',func=pin_types.OUTPUT,unit=1),
            Pin(num='5',name='XTI',func=pin_types.PASSIVE,unit=1),
            Pin(num='6',name='VSN_D',func=pin_types.PWRIN,unit=1),
            Pin(num='7',name='VSP_A',func=pin_types.PWROUT,unit=1),
            Pin(num='8',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='9',name='VSP_RF',func=pin_types.PWROUT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'ST25DV04K-JFR6D3', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'ST25DV04K-JFR6D3'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm', 'Package_DFN_QFN:ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm'], 'footprint':'Package_DFN_QFN:ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm', 'keywords':'NFC Tag', 'description':'', 'datasheet':'https://www.st.com/resource/en/datasheet/st25dv04k.pdf', 'search_text':'/usr/share/kicad/symbols/RF_NFC.kicad_sym\nST25DV04K-JFR6D3\n\nNFC Tag', 'pins':[
            Pin(num='1',name='LPD',func=pin_types.INPUT,unit=1),
            Pin(num='10',name='VDCG',func=pin_types.PWRIN,unit=1),
            Pin(num='11',name='GPO',func=pin_types.OUTPUT,unit=1),
            Pin(num='12',name='VCC',func=pin_types.PWRIN,unit=1),
            Pin(num='13',name='NC',func=pin_types.NOCONNECT,unit=1),
            Pin(num='2',name='NC',func=pin_types.NOCONNECT,unit=1),
            Pin(num='3',name='V_EH',func=pin_types.PWROUT,unit=1),
            Pin(num='4',name='AC0',func=pin_types.PASSIVE,unit=1),
            Pin(num='5',name='AC1',func=pin_types.PASSIVE,unit=1),
            Pin(num='6',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='7',name='SDA',func=pin_types.BIDIR,unit=1),
            Pin(num='8',name='SCL',func=pin_types.INPUT,unit=1),
            Pin(num='9',name='NC',func=pin_types.NOCONNECT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'ST25DV16K-IER8C3', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'ST25DV16K-IER8C3'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm', 'Package_DFN_QFN:DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm'], 'footprint':'Package_DFN_QFN:DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm', 'keywords':'NFC Tag', 'description':'', 'datasheet':'https://www.st.com/resource/en/datasheet/st25dv04k.pdf', 'search_text':'/usr/share/kicad/symbols/RF_NFC.kicad_sym\nST25DV16K-IER8C3\n\nNFC Tag', 'pins':[
            Pin(num='1',name='V_EH',func=pin_types.PWROUT,unit=1),
            Pin(num='2',name='AC0',func=pin_types.PASSIVE,unit=1),
            Pin(num='3',name='AC1',func=pin_types.PASSIVE,unit=1),
            Pin(num='4',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='5',name='SDA',func=pin_types.BIDIR,unit=1),
            Pin(num='6',name='SCL',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='GPO',func=pin_types.OPENCOLL,unit=1),
            Pin(num='8',name='VCC',func=pin_types.PWRIN,unit=1),
            Pin(num='9',name='NC',func=pin_types.NOCONNECT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'ST25DV64K-IER8C3', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'ST25DV64K-IER8C3'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm', 'Package_DFN_QFN:DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm', 'Package_DFN_QFN:DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm'], 'footprint':'Package_DFN_QFN:DFN-8-1EP_3x2mm_P0.5mm_EP1.36x1.46mm', 'keywords':'NFC Tag', 'description':'', 'datasheet':'https://www.st.com/resource/en/datasheet/st25dv04k.pdf', 'search_text':'/usr/share/kicad/symbols/RF_NFC.kicad_sym\nST25DV64K-IER8C3\n\nNFC Tag', 'pins':[
            Pin(num='1',name='V_EH',func=pin_types.PWROUT,unit=1),
            Pin(num='2',name='AC0',func=pin_types.PASSIVE,unit=1),
            Pin(num='3',name='AC1',func=pin_types.PASSIVE,unit=1),
            Pin(num='4',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='5',name='SDA',func=pin_types.BIDIR,unit=1),
            Pin(num='6',name='SCL',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='GPO',func=pin_types.OPENCOLL,unit=1),
            Pin(num='8',name='VCC',func=pin_types.PWRIN,unit=1),
            Pin(num='9',name='NC',func=pin_types.NOCONNECT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'ST25DV64K-JFR6D3', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'ST25DV64K-JFR6D3'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm', 'Package_DFN_QFN:ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm', 'Package_DFN_QFN:ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm'], 'footprint':'Package_DFN_QFN:ST_UFDFPN-12-1EP_3x3mm_P0.5mm_EP1.4x2.55mm', 'keywords':'NFC Tag', 'description':'', 'datasheet':'https://www.st.com/resource/en/datasheet/st25dv04k.pdf', 'search_text':'/usr/share/kicad/symbols/RF_NFC.kicad_sym\nST25DV64K-JFR6D3\n\nNFC Tag', 'pins':[
            Pin(num='1',name='LPD',func=pin_types.INPUT,unit=1),
            Pin(num='10',name='VDCG',func=pin_types.PWRIN,unit=1),
            Pin(num='11',name='GPO',func=pin_types.OUTPUT,unit=1),
            Pin(num='12',name='VCC',func=pin_types.PWRIN,unit=1),
            Pin(num='13',name='NC',func=pin_types.NOCONNECT,unit=1),
            Pin(num='2',name='NC',func=pin_types.NOCONNECT,unit=1),
            Pin(num='3',name='V_EH',func=pin_types.PWROUT,unit=1),
            Pin(num='4',name='AC0',func=pin_types.PASSIVE,unit=1),
            Pin(num='5',name='AC1',func=pin_types.PASSIVE,unit=1),
            Pin(num='6',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='7',name='SDA',func=pin_types.BIDIR,unit=1),
            Pin(num='8',name='SCL',func=pin_types.INPUT,unit=1),
            Pin(num='9',name='NC',func=pin_types.NOCONNECT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'ST25R3911B-AQF', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'ST25R3911B-AQF'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:VQFN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm_ThermalVias', 'Package_DFN_QFN:QFN-32-1EP_5x5mm_P0.5mm_EP3.6x3.6mm_ThermalVias'], 'footprint':'Package_DFN_QFN:VQFN-32-1EP_5x5mm_P0.5mm_EP3.5x3.5mm_ThermalVias', 'keywords':'NFC', 'description':'', 'datasheet':'https://www.st.com/resource/en/datasheet/st25r3911b.pdf', 'search_text':'/usr/share/kicad/symbols/RF_NFC.kicad_sym\nST25R3911B-AQF\n\nNFC', 'pins':[
            Pin(num='1',name='VDD_IO',func=pin_types.PWRIN,unit=1),
            Pin(num='10',name='RFO1',func=pin_types.OUTPUT,unit=1),
            Pin(num='11',name='RFO2',func=pin_types.OUTPUT,unit=1),
            Pin(num='12',name='VSN_RF',func=pin_types.PWRIN,unit=1),
            Pin(num='13',name='TRIM1_3',func=pin_types.PASSIVE,unit=1),
            Pin(num='14',name='TRIM2_3',func=pin_types.PASSIVE,unit=1),
            Pin(num='15',name='TRIM1_2',func=pin_types.PASSIVE,unit=1),
            Pin(num='16',name='TRIM2_2',func=pin_types.PASSIVE,unit=1),
            Pin(num='17',name='TRIM1_1',func=pin_types.PASSIVE,unit=1),
            Pin(num='18',name='TRIM2_1',func=pin_types.PASSIVE,unit=1),
            Pin(num='19',name='TRIM1_0',func=pin_types.PASSIVE,unit=1),
            Pin(num='2',name='CSO',func=pin_types.OUTPUT,unit=1),
            Pin(num='20',name='TRIM2_0',func=pin_types.PASSIVE,unit=1),
            Pin(num='21',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='22',name='RFI1',func=pin_types.PASSIVE,unit=1),
            Pin(num='23',name='RFI2',func=pin_types.PASSIVE,unit=1),
            Pin(num='24',name='AGD',func=pin_types.PASSIVE,unit=1),
            Pin(num='25',name='CSI',func=pin_types.PASSIVE,unit=1),
            Pin(num='26',name='VSN_A',func=pin_types.PWRIN,unit=1),
            Pin(num='27',name='IRQ',func=pin_types.OUTPUT,unit=1),
            Pin(num='28',name='MCU_CLK',func=pin_types.OUTPUT,unit=1),
            Pin(num='29',name='MISO',func=pin_types.OUTPUT,unit=1),
            Pin(num='3',name='VSP_D',func=pin_types.PWROUT,unit=1),
            Pin(num='30',name='MOSI',func=pin_types.INPUT,unit=1),
            Pin(num='31',name='SCLK',func=pin_types.INPUT,unit=1),
            Pin(num='32',name='/SS',func=pin_types.INPUT,unit=1),
            Pin(num='33',name='EP',func=pin_types.PWRIN,unit=1),
            Pin(num='4',name='XTO',func=pin_types.OUTPUT,unit=1),
            Pin(num='5',name='XTI',func=pin_types.PASSIVE,unit=1),
            Pin(num='6',name='VSN_D',func=pin_types.PWRIN,unit=1),
            Pin(num='7',name='VSP_A',func=pin_types.PWROUT,unit=1),
            Pin(num='8',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='9',name='VSP_RF',func=pin_types.PWROUT,unit=1)], 'unit_defs':[] })])